package otelmod

import (
	"context"
	"github.com/kitex-contrib/obs-opentelemetry/provider"
)

var TracerProvider provider.OtelProvider

func TracerProviderInit(serviceName string) {
	p := provider.NewOpenTelemetryProvider(
		provider.WithServiceName(serviceName),
		provider.WithExportEndpoint("localhost:4317"),
		provider.WithInsecure(),
	)
	TracerProvider = p
}

func ProviderShutdown() {
	TracerProvider.Shutdown(context.Background())
}
